import dayjs from 'dayjs';
import {CULTURAL, HOTEL, AGENCY, LIBRARY, MUSEUM, SCENIC, VILLAGE} from "@/enums/ResourceType";
import {defineAppConfig} from "@/config/interface";

/**
 * 21 佳县
 */
const Config = defineAppConfig('21', {
  map: {
    center: [110.335856, 38.02015],
    zoom: 12,
    components: {
      resource: {
        //TODO 缺少住宿、旅行社
        types: [SCENIC, HOTEL, AGENCY, VILLAGE, MUSEUM, LIBRARY, CULTURAL],
        modals: {
          //景区弹窗
          [SCENIC]: {
            title: "{name}",
            tabs: [
              {
                label: "主页",
                url: "https://shuzhi-public.tourage.cn/resourceModel/scenic?apiURL={apiUrl}&id={id}&token={token}",
                height: 635
              },
              {
                label: "视频监控",
                url: "https://shuzhi-public.tourage.cn/video?apiURL={apiUrl}&zoneCode={zoneCode}&type=scenic&name={name}&token={token}",
                height: 631
              }
            ]
          },
        },
        request: {
          getLevelPie: ({type}: any) => {
            if (type === AGENCY) {
              return Promise.resolve([
                {name: "主社", data: 1},
                {name: "分社", data: 2}
              ])
            }
            return false
          }
        },
      },
    },
  },
  analyse: {
    scenicTourist: {
      defaultScopeValue: {
        date: dayjs().add(-1, 'day'),
        month: dayjs().add(-1, 'month')
      },
      defaultValues: {
        scope: 'date',
        date: dayjs().subtract(1, 'day'),
      }
    },
    globalTourist: {
      defaultScopeValue: {
        date: dayjs().add(-1, 'day'),
        month: dayjs()
      },
      defaultValues: {
        scope: 'date',
        date: dayjs().subtract(1, 'day'),
      }
    },
    scenicComment:{
      defaultScopeValue: {
        month: dayjs().add(-1, 'month')
      },
      defaultValues: {
        scope: 'all',
        date: dayjs().subtract(1, 'day'),
      }
    }
  }
})

export default Config
